<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<style>
    .hhzhu{
        position: relative;
        top: 2px;
        left: -4px;
    }
    }
</style>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">
        <div><?php include "../public_flow/flow_show_info.php";?></div>
        <div class="tongbox tongbox5">
            <div class="tuo"><div class="tit">项目名称</div><div class="con" id="tong_enginname"></div></div>
            <div class="tuo"><div class="tit">联营方/委托方</div><div class="con" id="tong_lian_unit"></div></div>
            <div class="tuo"><div class="tit">我方单位</div><div class="con" id="tong_myer_name"></div></div>
            <div class="tuo"><div class="tit">管理费费率(%)</div><div class="con" id="tong_guanrate"></div></div>
            <div class="tuo"><div class="tit">税费费率(%)</div><div class="con" id="tong_shuirate"></div></div>
        </div>
        <div class="table-box tablenes">
            <div class="title">项目信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">项目名称</td><td class="tv colorlan" id="enginid_name" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">合同信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">合同名称</td><td id="name" class="tv" colspan="3"></td></tr>
                <tr><td class="tt">合同编号</td><td id="number" class="tv"></td><td class="tt">合同年份</td><td id="year" class="tv"></td></tr>
                <tr><td class="tt">联营方/委托方</td><td id="lian_unit" class="tv"></td><td class="tt">我方单位</td><td id="myer_name" class="tv"></td></tr>
                <tr><td class="tt">合同状态</td><td id="state" class="tv"></td><td class="tt">签订日期</td><td id="qiandt" class="tv"></td></tr>
                <tr><td class="tt">合同份数</td><td id="henum" class="tv"></td><td class="tt">我方签订人</td><td id="yiqianer" class="tv"></td></tr>
                <tr><td class="tt">备注</td><td class="tv" id="explain" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">主要条款</div>
            <table class="layui-table">
                <tbody>
                <tr>
                    <td class="tt"><i class="layui-icon layui-icon-about hhzhu hhzhu_guanrate"></i>管理费费率(%)</td><td id="guanrate" class="tv"></td>
                    <td class="tt">  <i class="layui-icon layui-icon-about hhzhu hhzhu_shuirate"></i>税费费率(%)</td><td id="shuirate" class="tv"></td>
                </tr>
                <tr><td class="tt">其他条款</td><td class="tv" id="clause" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div><?php include "../public/upinfo_show.php";?></div>

        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>

        <div><?php include '../public_flow/flow_show_shenlog.php'?></div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>


    <div class="showrrboxtext">
        <div class="table-box tablenes">
            <div class="title">项目收入</div>
            <div class="tuo"><div class="tit">工程回款金额(元)</div><div class="con" id="business_2_win_shougonghuifee">0</div></div>
            <div class="tuo"><div class="tit">联营方备用金金额(元)</div><div class="con" id="business_2_win_shoulianbeifee">0</div></div>
            <div class="tuo"><div class="tit">收入合计(元)</div><div class="con" id="business_2_win_lianyingshoufee">0</div></div>
        </div>
        <div class="table-box tablenes">
            <div class="title">项目支出</div>
            <div class="tuo"><div class="tit">项目付款金额(元)</div><div class="con" id="business_2_win_zhixiangfee">0</div></div>
            <div class="tuo"><div class="tit">联营结算金额(元)</div><div class="con" id="business_2_win_zhilianjiefee">0</div></div>
            <div class="tuo"><div class="tit">支出合计(元)</div><div class="con" id="business_2_win_lianyingzhifee">0</div></div>
        </div>
        <div class="table-box tablenes">
            <div class="title">费用扣收</div>
            <div class="tuo"><div class="tit">管理费费率(%)</div><div class="con" id="business_2_win_lian_guanrate">0</div></div>
            <div class="tuo"><div class="tit">应扣管理费(元)</div><div class="con" id="business_2_win_lian_guanfee">0</div></div>
            <div class="tuo"><div class="tit">已扣管理费(元)</div><div class="con" id="business_2_win_kou_guanfee">0</div></div>
            <div class="tuo"><div class="tit">待扣管理费(元)</div><div class="con" id="business_2_win_dai_guanfee">0</div></div>
            <div class="tuo"><div class="tit">税费费率(%)</div><div class="con" id="business_2_win_lian_shuirate">0</div></div>
            <div class="tuo"><div class="tit">应扣税费(元)</div><div class="con" id="business_2_win_lian_shuifee">0</div></div>
            <div class="tuo"><div class="tit">已扣税费(元)</div><div class="con" id="business_2_win_kou_shuifee">0</div></div>
            <div class="tuo"><div class="tit">待扣税费(元)</div><div class="con" id="business_2_win_dai_shuifee">0</div></div>
            <div class="tuo"><div class="tit">其他扣收金额(元)</div><div class="con" id="business_2_win_kou_qifee">0</div></div>
            <div class="tuo"><div class="tit">扣收合计(元)</div><div class="con" id="business_2_win_kou_allfee">0</div></div>
        </div>
        <div class="table-box tablenes">
            <div class="title">项目发票</div>
            <div class="tuo"><div class="tit">项目开票金额(元)</div><div class="con" id="business_2_win_kai_money">0</div></div>
            <div class="tuo"><div class="tit">销项税额(元)</div><div class="con" id="business_2_win_kai_ratefee">0</div></div>
            <div class="tuo"><div class="tit">项目收票金额(元)</div><div class="con" id="business_2_win_shou_money">0</div></div>
            <div class="tuo"><div class="tit">进项税额(元)</div><div class="con" id="business_2_win_shou_ratefee">0</div></div>
            <div class="tuo"><div class="tit">应计增值税(元)</div><div class="con" id="business_2_win_zengzhifee">0</div></div>
        </div>
        <div class="table-box tablenes">
            <div class="title">资金余额</div>
            <div class="tuo"><div class="tit">项目资金余额(元)</div><div class="con" id="business_2_win_balancefee">0</div></div>
        </div>
    </div>
    <div><?php include '../public/shrrbox.php'?></div>
</div>
<script>
    var param_isdan = getQueryVariable('isdan') || 0;
    if(param_isdan > 0){
        $("#page-close").remove();
    }
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_contract_lian_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;
                var engininfo = res.data.engininfo;
                $("#flowdingname").text(data.name);

                if(engininfo){
                    $("#tong_enginname").text(engininfo.name);
                }
                $("#tong_lian_unit").text(data.lian_unit);
                $("#tong_myer_name").text(data.myer_name);
                $("#tong_guanrate").text(data.guanrate);
                $("#tong_shuirate").text(data.shuirate);

                if(engininfo){
                    $("#business_2_win_shougonghuifee").text(parseFormatNum(engininfo.shougonghuifee)).addClass('colorlan').click(function () {
                        openNavPage('查看项目收款信息','shou_xiang/index.php?status=1&feilei_option=xmsr_gchk&enginid='+engininfo.id);
                    });
                    $("#business_2_win_shoulianbeifee").text(parseFormatNum(engininfo.shoulianbeifee)).addClass('colorlan').click(function () {
                        openNavPage('查看项目收款信息','shou_xiang/index.php?status=1&feilei_option=xmsr_lyfbyj&enginid='+engininfo.id);
                    });
                    $("#business_2_win_lianyingshoufee").text(parseFormatNum(engininfo.lianyingshoufee));
                    $("#business_2_win_zhixiangfee").text(parseFormatNum(engininfo.zhixiangfee)).addClass('colorlan').click(function () {
                        openNavPage('查看项目付款信息','zhi_xiang/index.php?status=1&enginid='+engininfo.id);
                    });
                    $("#business_2_win_zhilianjiefee").text(parseFormatNum(engininfo.zhilianjiefee)).addClass('colorlan').click(function () {
                        openNavPage('查看联营结算信息','zhi_lianjie/index.php?status=1&enginid='+data.id);
                    });
                    $("#business_2_win_lianyingzhifee").text(parseFormatNum(engininfo.lianyingzhifee));
                    $("#business_2_win_lian_guanrate").text(engininfo.lian_guanrate).addClass('colorlan').click(function () {
                        openNavPage('查看联营合同信息','contract_lian/index.php?status=1&enginid='+engininfo.id);
                    });
                    $("#business_2_win_lian_guanfee").text(parseFormatNum(engininfo.lian_guanfee));
                    $("#business_2_win_kou_guanfee").text(parseFormatNum(engininfo.kou_guanfee)).addClass('colorlan').click(function () {
                        openNavPage('查看费用扣收信息','lian_koulan/index.php?status=1&feitype_option=xmsr_lyfyhks_glf&enginid='+engininfo.id);
                    });
                    $("#business_2_win_dai_guanfee").text(parseFormatNum(engininfo.dai_guanfee));
                    $("#business_2_win_lian_shuirate").text(engininfo.lian_shuirate).addClass('colorlan').click(function () {
                        openNavPage('查看联营合同信息','contract_lian/index.php?status=1&enginid='+engininfo.id);
                    });
                    $("#business_2_win_lian_shuifee").text(parseFormatNum(engininfo.lian_shuifee));
                    $("#business_2_win_kou_shuifee").text(parseFormatNum(engininfo.kou_shuifee)).addClass('colorlan').click(function () {
                        openNavPage('查看费用扣收信息','lian_koulan/index.php?status=1&feitype_option=xmsr_lyfyhks_sf&enginid='+engininfo.id);
                    });
                    $("#business_2_win_dai_shuifee").text(parseFormatNum(engininfo.dai_shuifee));
                    $("#business_2_win_kou_qifee").text(parseFormatNum(engininfo.kou_qifee)).addClass('colorlan').click(function () {
                        openNavPage('查看费用扣收信息','lian_koulan/index.php?status=1&feitype_option=noguannoshui&enginid='+engininfo.id);
                    });
                    $("#business_2_win_kou_allfee").text(parseFormatNum(engininfo.kou_allfee));
                    $("#business_2_win_kai_money").text(parseFormatNum(engininfo.kai_money)).addClass('colorlan').click(function () {
                        openNavPage('查看项目开票信息','piao_kai/index.php?status=1&enginid='+engininfo.id);
                    });
                    $("#business_2_win_kai_ratefee").text(parseFormatNum(engininfo.kai_ratefee)).addClass('colorlan').click(function () {
                        openNavPage('查看项目开票信息','piao_kai/index.php?status=1&enginid='+engininfo.id);
                    });
                    $("#business_2_win_shou_money").text(parseFormatNum(engininfo.shou_money)).addClass('colorlan').click(function () {
                        openNavPage('查看项目收票信息','piao_shou/index.php?status=1&enginid='+engininfo.id);
                    });
                    $("#business_2_win_shou_ratefee").text(parseFormatNum(engininfo.shou_ratefee)).addClass('colorlan').click(function () {
                        openNavPage('查看项目收票明细信息','piao_shou/detail.php?status=1&enginid='+engininfo.id);
                    });
                    $("#business_2_win_zengzhifee").text(parseFormatNum(engininfo.zengzhifee));
                    $("#business_2_win_balancefee").text(parseFormatNum(engininfo.balancefee));
                    if(engininfo.balancefee < 0){
                        $("#business_2_win_balancefee").addClass('colorhong');
                    }
                }









                if(engininfo){
                    $("#enginid_name").text(engininfo.name).click(function () {
                        openPage('../engin/show.php?id='+engininfo.id);
                    });
                }


                $("#name").text(data.name);
                $("#number").text(data.number);
                $("#year").text(data.year);
                $("#lian_unit").text(data.lian_unit);
                $("#myer_name").text(data.myer_name);
                $("#state").text(data.state);
                $("#qiandt").text(data.qiandt);
                $("#henum").text(data.henum);
                $("#yiqianer").text(data.yiqianer);
                $("#explain").text(data.explain);
                $("#guanrate").text(data.guanrate);
                $("#shuirate").text(data.shuirate);
                $("#clause").text(data.clause);


                public_flow_show_display(res.data.billinfo);
                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('contract_lian', param_id);
    });






    $(".hhzhu_guanrate").hover(function(){
        hhzhu_index = layer.tips('项目管理费=累计工程回款金额X管理费费率/100',this,{time:0});
    },function(){layer.close(hhzhu_index);});

    $(".hhzhu_shuirate").hover(function(){
        hhzhu_index = layer.tips('项目税费=累计开票金额含税X税费费率/100',this,{time:0});
    },function(){layer.close(hhzhu_index);});


</script>
</body>
</html>




